package jtk.project4.fleet.screen.poselection;

import java.awt.FlowLayout;

import jtk.project4.fleet.field.POSelectionField;

import nl.coderight.jazz.form.FormField;
import nl.coderight.jazz.form.FormHeader;
import nl.coderight.jazz.form.FormView;
import nl.coderight.jazz.form.control.GroupControl;
import nl.coderight.jazz.form.field.TableField;
import nl.coderight.jazz.form.field.button.CheckButton;
import nl.coderight.jazz.form.field.button.PushButton;

public class POSelectionView  extends FormView{
	private TableField poSelectionTable ;
	private FormHeader formHeader;
	private PushButton okButton;
	private POSelectionField poSelectionField;
	private CheckButton ignore;
	
	protected void init() {
		createFields();
		createLayout();
	}
	
	private FormHeader createHeader() {
		formHeader = new FormHeader();
		formHeader.setTitle("PO Selection");
		return formHeader;
	}
	
	private void createLayout() {
		setHeader(createHeader());
		addField(createForm());
	
	}
	
	private void createFields() {
		okButton = new PushButton("OK");
		ignore = new CheckButton("ignore vendor during PO generation");
		
	}
	
	private GroupControl createForm()
	{
		GroupControl form = new GroupControl();	
		form.addField(new POSelectionField("PO Selection"),NORTH);
		form.addField(createButtons(), SOUTH);
		form.addField(ignore);
		
		return form;
	}
	
	private GroupControl createButtons() {
		GroupControl buttons = new GroupControl();
		buttons.setLayout(new FlowLayout(FlowLayout.RIGHT));
		buttons.addField(okButton);
		return buttons ;
	}
}
